import sys
import os
from pathlib import Path
import inspect
libpath=(str(Path(inspect.getsourcefile(lambda:0)).parent.parent.resolve()))
sys.path.insert(0,libpath)
import pytest
#print(sys.path)
from brower.brower import WebBrower

from time import sleep
i=1
@pytest.fixture
def fixture():
    webBrower=WebBrower()
    yield webBrower
    webBrower.close()
    print("close " + "i++")


@pytest.mark.parametrize('urlOrFile',['https://git-scm.com/book/','~/note/SpaceVim/tools/algorithm/thinks.md'])
def test_openUrl(fixture,urlOrFile):
    #webBrower=WebBrower()
    webBrower=fixture
    webBrower.openUrl(urlOrFile)
    sleep(2)
    #webBrower.close()

if __name__=="__main__":
    print(inspect.getsourcefile(setup_function))
    #pytest.main([inspect.getsourcefile(lambda:0)])
